package com.aaa.ssm.controller;

import com.aaa.ssm.entity.GradeDTO;
import com.aaa.ssm.result.AjaxResult;
import com.aaa.ssm.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("grade")
public class GradeController {
    @Autowired
    private GradeService gradeService;
    @GetMapping("list")
    public AjaxResult list(){

           List<GradeDTO>  grades = gradeService.listAllGrade();
           return AjaxResult.success(grades);

    }

}
